package com.zbh.uexam.exception;

/**
 * @Author zhoubh
 * @Date 2021/5/16 16:43
 * @Version 1.0
 * @description:
 */
public class CodeException extends RuntimeException {
    public static final int UNKNOWN_EXCEPTION = 0;

    private int code;

    public CodeException() {
        super();
    }

    public CodeException(String message, Throwable cause) {
        super(message, cause);
    }

    public CodeException(String message) {
        super(message);
    }

    public CodeException(Throwable cause) {
        super(cause);
    }

    public CodeException(int code) {
        super();
        this.code = code;
    }

    public CodeException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public CodeException(int code, String message) {
        super(message);
        this.code = code;
    }

    public CodeException(int code, Throwable cause) {
        super(cause);
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isUnknown() {
        return code == UNKNOWN_EXCEPTION;
    }
}
